Matplotlib Example
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
fruits = ['apple', 'blueberry', 'cherry', 'orange']
counts = [40, 100, 30, 55]
bar_labels = ['green', 'blue', 'red', 'orange']
bar_colors = ['tab:green', 'tab:blue', 'tab:red', 'tab:orange']
ax.bar(fruits, counts, label=bar_labels, color=bar_colors) # The "ax.bar" function is used to create the bar chart
ax.set_ylabel('fruit supply') # The "ax.set_ylabel" is used to set the labels for the y-axis
ax.set_title('Fruit supply by kind and color') # This function set the title of the chart
ax.legend(title='Fruit color') # this will create a legend for bar chart
plt.show() # the "plt.show()" function is used to display the chart.
Plotly Example
import plotly.express as px
import plotly
plotly.offline.init_notebook_mode()
df = px.data.iris()
df["e"] = df["sepal_width"]/100
# Creating a scatter plot using Plotly Express
fig = px.scatter(df, x="sepal_width", y="sepal_length", color="species", error_x="e", error_y="e")
fig.show()
Seaborn Example
import seaborn as sns
sns.set_theme(style="whitegrid")
planets = sns.load_dataset("planets")
# Create a cubehelix color palette
cmap = sns.cubehelix_palette(rot=-.2, as_cmap=True)
# Create a relational plot using relplot
g = sns.relplot(
data=planets,
x="distance", y="orbital_period",
hue="year", size="mass",
palette=cmap, sizes=(10, 200),
)
g.set(xscale="log", yscale="log")
g.ax.xaxis.grid(True, "minor", linewidth=.25)
g.ax.yaxis.grid(True, "minor", linewidth=.25)
g.despine(left=True, bottom=True)
<seaborn.axisgrid.FacetGrid at 0x1dbff1a7f90>
A Hyperlink
Machine learning method speeds up discovery of green energy materials
An Image

A Table
| Year | Market Size (In Billion USD) |
|---|---|
| 2022 | $103.7 |
| 2023 | $123.1 |
| 2024 | $146.1 |
| 2025 | $173.6 |
| 2026 | $201.0 |
| 2027 | $242.4 |
| 2028 | $292.9 |
| 2029 | $353.7 |
| 2030 | $415.8 |
This table is created by taking data from Precedence Research.